package com.example;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Property;
import de.greenrobot.daogenerator.Schema;
import de.greenrobot.daogenerator.ToMany;



public class ExampleDaoGenerator {
    public static void main(String[] args) throws Exception {
        Schema schema = new Schema(1, "com.tky.conference.dao");
        addLoginInfo(schema);
        addComeetingInfo(schema);
        addAppointInfo(schema);
        addDeptInfo(schema);
        addTreeInfo(schema);
        addHysInfo(schema);
        new DaoGenerator().generateAll(schema, "./app/src/main/java");
    }

    //用户登录
    private  static  void addLoginInfo(Schema schema){
        Entity mixingInfo=schema.addEntity("LoginInfo");
        mixingInfo.addStringProperty("orgId").primaryKey();
        mixingInfo.addStringProperty("depid");
        mixingInfo.addStringProperty("depname");
        mixingInfo.addStringProperty("username");
        mixingInfo.addStringProperty("logopath");
    }

    //我的会议
    private  static  void addComeetingInfo(Schema schema){
        Entity mixingInfo=schema.addEntity("ComeetingInfo");
        mixingInfo.addStringProperty("id").primaryKey();
        mixingInfo.addStringProperty("hyzt");
        mixingInfo.addStringProperty("hysmc");
        mixingInfo.addStringProperty("stime");
        mixingInfo.addStringProperty("etime");
        mixingInfo.addStringProperty("hydd");
        mixingInfo.addStringProperty("zbbm");
        mixingInfo.addStringProperty("status");
        mixingInfo.addStringProperty("fzr");
        mixingInfo.addStringProperty("chry");
        mixingInfo.addStringProperty("message");
        mixingInfo.addStringProperty("jlr");
        mixingInfo.addStringProperty("sqr");
        mixingInfo.addStringProperty("useflag");//1：该条记录有效，0：无效
        mixingInfo.addStringProperty("createat");
        mixingInfo.addStringProperty("fzrid");
        mixingInfo.addStringProperty("hysid");
        mixingInfo.addStringProperty("jlrid");
        mixingInfo.addStringProperty("orgid");
        mixingInfo.addStringProperty("chryid");
        mixingInfo.addStringProperty("hyms");
    }

    //预约会议列表
    private static void addAppointInfo(Schema schema){
        Entity mixingInfo=schema.addEntity("AppointInfo");
        mixingInfo.addStringProperty("id").primaryKey();
        mixingInfo.addStringProperty("hyzt");
        mixingInfo.addStringProperty("hysmc");
        mixingInfo.addStringProperty("stime");
        mixingInfo.addStringProperty("etime");
        mixingInfo.addStringProperty("hydd");
        mixingInfo.addStringProperty("status");
        mixingInfo.addStringProperty("fzr");
        mixingInfo.addStringProperty("chry");
        mixingInfo.addStringProperty("message");
        mixingInfo.addStringProperty("jlr");
        mixingInfo.addStringProperty("sqr");
        mixingInfo.addStringProperty("useflag");//1：该条记录有效，0：无效
        mixingInfo.addStringProperty("zbbm");
        mixingInfo.addStringProperty("createat");
        mixingInfo.addStringProperty("fzrid");
        mixingInfo.addStringProperty("hysid");
        mixingInfo.addStringProperty("jlrid");
        mixingInfo.addStringProperty("orgid");
        mixingInfo.addStringProperty("chryid");
        mixingInfo.addStringProperty("hyms");
    }

    //部门结构
    private static void addDeptInfo(Schema schema) {
        Entity customer = schema.addEntity("DeptInfo");
        customer.addStringProperty("id").primaryKey();
        customer.addStringProperty("name");
    }

    //树结构
    private static void addTreeInfo(Schema schema) {
        Entity customer = schema.addEntity("TreeInfo");
        customer.addStringProperty("id").primaryKey();
        customer.addStringProperty("pid");
        customer.addStringProperty("name");
        customer.addStringProperty("type");
    }

    //会议室结构
    private static void addHysInfo(Schema schema) {
        Entity customer = schema.addEntity("HysInfo");
        customer.addStringProperty("id").primaryKey();
        customer.addStringProperty("pid");
        customer.addStringProperty("name");
    }
}